<template>
    <div>
        名称:
        <input type="text" v-model="von.name" >
        类型:
        <select v-model="von.id" >
            <option value="">请选择</option>
            <option :value="o.pid" v-for="o in fand" >{{ o.pname }}</option>
        </select>
        <input type="button" value="查询" @click="Show" >
        <table>
            <thead>
                <tr>
                    <td>计划名称</td>
                    <td>关联房型</td>
                    <td>计划类型</td>
                    <td>价格</td>
                    <td>状态</td>
                    <td>功能</td>
                </tr>

                <tr v-for="o in info" >
                    <td>{{ o.uName }}</td>
                    <td>{{ o.mName }}</td>
                    <td>{{ o.pname }}</td>
                    <td>{{ o.phone }}</td>
                    <td>{{ o.state==1?"启用":"禁用" }}</td>
                    <td>功能</td>
                </tr>
            </thead>
        </table>
    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { onMounted, ref } from 'vue';

let info:any=ref([]);

let von:any=ref({
    name:'',
    id:''
});

let fand:any=ref([]);

onMounted(()=>{
    Show()
    List()
})

const Show=()=>{
    axios({
        url:'https://localhost:7078/api/User/Show',
        method:'get',
        params:von.value
    })
    .then((res)=>{
        console.log(res);
        info.value=res.data;
    } )
}

const List=()=>{
    axios({
        url:'https://localhost:7078/api/User/List',
        method:'get',
    })
    .then((res)=>{
        console.log(res);
        fand.value=res.data;
    } )
}

</script>

<style scoped>

</style>
